Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 8, 2025

This PR removes all usage of the deprecated sx prop from Timeline.dev.stories.tsx and migrates to CSS modules, as part of the ongoing effort to move away from styled-components.

Changes Made

Created Timeline.dev.stories.module.css

A new CSS module containing all the styles that were previously defined using sx props:

  • Timeline margin-left styling (.TimelineWithMarginLeft)
  • Timeline.Item padding styles (.TimelineItemWithPadding)
  • Timeline.Badge background colors for different states (.TimelineBadgeCanvas, .TimelineBadgeDanger, .TimelineBadgeAccent)
  • Timeline.Body text and flex layout styles (.TimelineBodySubtle, .TimelineBodyDefault)
  • Timeline.Break border width styling (.TimelineBreakThick)

Updated Timeline.dev.stories.tsx

  • Added imports for clsx and the CSS module
  • Replaced all sx props with className using CSS module classes
  • Used clsx to properly combine existing class names with new CSS module classes
  • Preserved all existing inline styles and component functionality

Before vs After

Before (using sx props):

<Timeline sx={{ ml: 4 }}>
  <Timeline.Item sx={{ pt: 2, pb: 1 }}>
    <Timeline.Badge sx={{ backgroundColor: 'canvas.default' }}>

After (using CSS modules):

<Timeline className={classes.TimelineWithMarginLeft}>
  <Timeline.Item className={classes.TimelineItemWithPadding}>
    <Timeline.Badge className={classes.TimelineBadgeCanvas}>

Validation

  • ✅ All existing tests pass
  • ✅ Build succeeds without errors
  • ✅ Story renders correctly in Storybook with all visual styling preserved
  • ✅ ESLint and Stylelint pass
  • ✅ No styled-components or sx prop usage remains

Timeline Dev Story After Changes

The Timeline Dev story continues to work exactly as before with all visual styling preserved, but now uses modern CSS modules instead of the deprecated sx prop system.

Fixes #6540.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copy link

changeset-bot bot commented Aug 8, 2025

⚠️ No Changeset found

Latest commit: a29a541

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Copilot Copilot AI changed the title [WIP] Update Timeline.dev.stories.tsx to no longer use styled-components Update Timeline.dev.stories.tsx to no longer use styled-components Aug 8, 2025
@Copilot Copilot AI requested a review from hectahertz August 8, 2025 15:42
Copilot finished work on behalf of hectahertz August 8, 2025 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Timeline.dev.stories.tsx to no longer use styled-components
2 participants